package com.zlcx.tz.live.vo;

import lombok.Data;

import java.util.List;

/**
 * <p></p>
 * <PRE>
 * <BR>    修改记录
 * <BR>-----------------------------------------------
 * <BR>    修改日期         修改人          修改内容
 * </PRE>
 * @author zl
 * @date Created in 2019/5/22 11:26
 * @version 1.0
 * @copyright: Copyright (c) founders
 */

@Data
public class AgoraProjectUsageVO {

    private String project;

    private List<AgoraProjectUsageDataVO> daily;

    private Long totalUsage;

    private Long audioTotalUsage;

    private Long sdTotalUsage;

    private Long hdTotalUsage;

    private Long hdpTotalUsage;

    @Data
    public static class AgoraProjectUsageDataVO{

        private String date;
        private int audio;
        private int sd;
        private int hd;
        private int hdp;

    }


    public Long getTotalUsage() {
        return getAudioTotalUsage()+getSdTotalUsage()+getHdTotalUsage()+getHdpTotalUsage();
    }

    public Long getAudioTotalUsage() {

        if(daily==null || daily.size()==0){
            return 0L;
        }

        Long n = 0L;
        for(AgoraProjectUsageDataVO dataVO:daily){
            n+=dataVO.getAudio();
        }
        return n;
    }


    public Long getSdTotalUsage() {

        if(daily==null || daily.size()==0){
            return 0L;
        }

        Long n = 0L;
        for(AgoraProjectUsageDataVO dataVO:daily){
            n+=dataVO.getSd();
        }
        return n;
    }



    public Long getHdTotalUsage() {

        if(daily==null || daily.size()==0){
            return 0L;
        }

        Long n = 0L;
        for(AgoraProjectUsageDataVO dataVO:daily){
            n+=dataVO.getHd();
        }
        return n;
    }


    public Long getHdpTotalUsage() {

        if(daily==null || daily.size()==0){
            return 0L;
        }

        Long n = 0L;
        for(AgoraProjectUsageDataVO dataVO:daily){
            n+=dataVO.getHdp();
        }
        return n;
    }


}
